package com.bds.snatch.system.common.task;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public abstract class CustTask<K> implements Job {
	private static Logger logger = Logger.getLogger(CustTask.class);

	public void execute(JobExecutionContext context) throws JobExecutionException {

		logger.info("###Start [process]..." + this.getClass().getName() + "####");
		try {
			this.process();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public abstract void doStart();

	public abstract void process() throws Exception;

	public abstract Thread getThread(K task);

}
